# we assume the JDK is like C:\Program Files\Java\jdk1.6.0,
# in other words, there is an extra space in its path
/loading/ {
 sub(/\[loading /, "", $0)
 sub(/lib\\ct.sym\(META-INF\/sym\//, "jre\\lib\\", $0)
 sub(/.jar\//, ".jar ", $0)
 sub(/\)\]$/, "", $0)
 n = split ($0, a, " ");
 j = sprintf("%s %s", a[1], a[2])
 c = a[3]
   if (length(jars[j]) == 0) {
    jars[j] = " ";
   }
   jars[j] = jars[j] " " c
   classes = classes " " c
}
END {
  for (jar in jars) {
   system("jar xvf \"" jar "\" " jars[jar]);
  }
  system("jar cf precj-rt.jar " classes);
  for (jar in jars) {
   system("rm -f " classes);
  }
}
